<template>
	<view>
		<view class="psxweb">
			<view class="header" v-if="this.show1 == 0">
				<view class="sing" @click="gotomy" v-show="yes">
					<img src="../../static/psx/签.png" alt="">
				</view>
				<view v-show='qiandao' @click="gotomy" class="sing">
					<img src="../../static/psx/ock.png" alt="">
				</view>

				<view class="person">
					<img src="../../static/psx/head.png" alt="">
				</view>
				<u-modal :show="show" @confirm="confirm" ref="uModal" :asyncClose="true" :content='content'></u-modal>
				<u-toast ref="uToast"></u-toast>
				<p class='text' @click="show = true">点击登录</p>
			</view>

			<view class="header" v-if="this.show1 == 1">
				<view class="sing" @click="gotomy" v-show="yes">
					<img src="../../static/psx/签.png" alt="">
				</view>
				<view v-show='qiandao' @click="gotomy" class="sing">
					<img src="../../static/psx/ock.png" alt="">
				</view>

				<view class="person">
					<img src="../../static/psx/sssx.png" alt="">
				</view>
				<p class='text'>在等星星吗.</p>
			</view>


			<view class="wallet" @click="gotowallet">
				<img src="../../static/psx/钱包.png" alt="">
				<p>我的钱包</p>
			</view>
			<view class="wallet1">
				<view class="integral" @click="gotointegral">
					<img src="../../static/psx/2060.png" alt="">
					<p>我的积分</p>
				</view>
				<view class="integral" @click='gotoactive'>
					<img src="../../static/psx/300.png" alt="">
					<p>我的活跃值</p>
				</view>
			</view>

			<view class="wallet2">
				<view class="integral" @click='gotocurriculum'>
					<img src="../../static/psx/课程.png" alt="">
					<p>我的课程</p>
				</view>
				<view class="integral" @click="gototrain">
					<img src="../../static/psx/pei.png" alt="">
					<p>我的培训</p>
				</view>
				<view class="integral" @click="gotofollow">
					<img src="../../static/psx/关注.png" alt="">
					<p>我的关注</p>
				</view>
				<view class="integral" @click='gotoquestions'>
					<img src="../../static/psx/2.png" alt="">
					<p>我的提问</p>
				</view>
				<view class="integral" @click='gotoanswers'>
					<img src="../../static/psx/2-1.png" alt="">
					<p>我的回答</p>
				</view>
				<view class="integral" @click="gotonformation">
					<img src="../../static/psx/6.png" alt="">
					<p>个人信息</p>
				</view>
				<view class="integral" @click="gotoabout">
					<img src="../../static/psx/xxx.png" alt="">
					<p>关于昕孕</p>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show1: 0,
				show: false,
				img: '',
				title: '',
				content: '请确认登录',
				qiandao: false,
				yes: true
			}
		},
		onLoad: function(opt) {
			let that = this
			uni.getStorage({
				key: 'token',
				success: function(res) {
					console.log(res.data);
					if (res.data == '登录') {
						// that.show =false
						that.show1 = 1
						console.log(this.show1);
					}
				}
			})
		},
		methods: {
			showModal() {
				this.show = true;
			},
			confirm() {
				setTimeout(() => {
					// this.show1=!this.show1
					localStorage.setItem('token', "登录")
					// 3秒后自动关闭
					uni.showToast({
						title: '登录成功'
					})
					this.show1 = 1;
				}, 1500)
			},
			gotonformation() {
				uni.navigateTo({
					url: '/pages/person/nformation'
				})
			},
			gotomy() {
				uni.navigateTo({
					url: '/pages/person/my'
				})
				this.yes = false
				this.qiandao = true
			},
			gotoabout() {
				uni.navigateTo({
					url: '/pages/person/about'
				})
			},
			gotoactive() {
				uni.navigateTo({
					url: '/pages/person/active'
				})
			},
			gotoanswers() {
				uni.navigateTo({
					url: '/pages/person/answers'
				})
			},
			gotofollow() {
				uni.navigateTo({
					url: '/pages/person/follow'
				})
			},
			gotoquestions() {
				uni.navigateTo({
					url: '/pages/person/questions'
				})
			},
			gotointegral() {
				uni.navigateTo({
					url: '/pages/person/integral'
				})
			},
			gototrain() {
				uni.navigateTo({
					url: '/pages/person/train'
				})
			},
			gotocurriculum() {
				uni.navigateTo({
					url: '/pages/person/curriculum'
				})
			},
			gotowallet() {
				uni.navigateTo({
					url: '/pages/person/wallet'
				})
			}
		}
	}
</script>

<style scoped>
	.psxweb {
		width: 100%;
		height: 100%;
		background-color: gainsboro;
		padding-bottom: 30upx;
	}

	.header {
		width: 100%;
		height: 460upx;
		background-color: white;
	}

	.sing {
		display: flex;
		justify-content: flex-end;
	}

	.sing img {
		width: 100upx;
		height: 100upx;
		padding: 20upx;
	}

	.person {
		width: 100%;
		height: 250upx;
		display: flex;

		justify-content: space-around;
	}

	.person img {
		width: 200upx;
		height: 200upx;
		border-radius: 50%;
	}

	.text {
		text-align: center;
		color: darkgray;
		font-size: 36upx;
	}

	.wallet {
		display: flex;
		width: 100%;
		height: 88upx;
		background-color: white;
		margin-top: 30upx;
		align-items: center;
	}

	.wallet img {
		width: 60upx;
		padding-left: 30upx;
		height: 60upx;
	}

	.wallet p {
		padding-left: 60upx;
	}

	.wallet1 {
		width: 100%;
		height: 176upx;
		background-color: white;
		margin-top: 30upx;
	}

	.integral {
		height: 88upx;
		display: flex;
		align-items: center;
		border-bottom: 1px solid silver;
	}

	.wallet1 img {
		width: 60upx;
		padding-left: 30upx;
		height: 30upx;
	}

	.wallet1 p {
		padding-left: 60upx;
	}

	.wallet2 {
		width: 100%;
		height: 628upx;
		background-color: white;
		margin-top: 30upx;
	}

	.wallet2 img {
		width: 60upx;
		padding-left: 30upx;
		height: 60upx;
	}

	.wallet2 p {
		padding-left: 60upx;
	}
</style>
